﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace Xiaozilang_Ordering_System
{
    public partial class AddRecords : Form
    {

        DataTable RcDt = new DataTable();
        public AddRecords()
        {
            InitializeComponent();
        }
        public static string  rnobth;
        private void AddRecords_Load(object sender, EventArgs e)
        {
            //文字背景透明
            label1.BackColor = Color.Transparent;
            RcdataGridView1.AutoGenerateColumns = false;
            Rcse();
        }
        private void Rcse()
        {
            string sql = string.Format("select * from Recharge where OrderID='{0}'and month(RechargeTime) like '%{1}%'", Shopping_Cart.UserJudge, rnobth);
            RcDt = DBHelper.SelectByAdapter(sql);
            RcdataGridView1.DataSource = RcDt;
        }
        private void RcSearch_Click(object sender, EventArgs e)
        {
            if (Rctxt.Text!="月份查询")
            {
                rnobth = Rctxt.Text;
            }
            Rcse();
        }

        private void Rctxt_MouseClick(object sender, MouseEventArgs e)
        {
            //Rctxt.Text = "";
        }

        private void btnquxiao_Click(object sender, EventArgs e)
        {
            AddMoney AM = new AddMoney();
            AM.Show();
            this.Close();
        }

        private void Rctxt_Enter(object sender, EventArgs e)
        {
            if (Rctxt.Text== "月份查询")
            {
                Rctxt.Text = "";
            }
        }

        private void Rctxt_Leave(object sender, EventArgs e)
        {
            if (Rctxt.Text == "")
            {
                rnobth = null;
                Rcse();
                Rctxt.Text = "月份查询";
            }
        }
    }
}
